#!/usr/bin/env python
# coding=utf8

import requests
import json

headers = {'content-type': 'application/json'}

config_data = open('config.json')
config = json.load(config_data)
config_data.close()
## -----------------------------------------------------------------------
## function about bts rpc
## -----------------------------------------------------------------------
auth = (config["bts_rpc"]["username"], config["bts_rpc"]["password"])
url = config["bts_rpc"]["url"]
wallet_name = config["wallet_name"]
wallet_pass = config["wallet_pass"]
dotp2p_name = config["dotp2p_name"]

def dotp2p_info():
  for name in dotp2p_name:
    request = {
                "method": "dotp2p_info",
                "params": [name],
                "jsonrpc": "2.0",
                "id": 1
              }
    responce = requests.post(url, data=json.dumps(request), headers=headers, auth=auth)
    print (responce.json())


if __name__ == "__main__":
  dotp2p_info()
